package com.demo2do.fms.entity.vehicle.source;

import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;
import org.springframework.format.annotation.DateTimeFormat;

import com.demo2do.core.format.PersistentFormat;
import com.demo2do.fms.entity.authority.Organization;
import com.demo2do.fms.entity.data.business.VehicleFeature;
import com.fasterxml.jackson.annotation.JsonIgnore;

/**
 * 驳运车
 * 
 * @author Wy
 */
@Entity
@Table(name = "VW_VEHICLE")
public class Vehicle {
    
    @Id
    @GeneratedValue(generator = "generator")
    @GenericGenerator(name = "generator", strategy = "assigned")
    private Long id;
    
    /** 车辆名称 */
    @Column(name = "VEHICLE_NAME")
    private String name;
    
    /** 车辆编号 */
    @Column(name = "VEHICLE_CODE")
    private String code;
    
    /** 车辆中文车牌号 */
    @Column(name = "NAME_DESC")
    private String brandCNCode;
    
    /**
     * 驳运车车牌
     */
    @Column(name = "VEHICLE_BAR_CODE")
    private String barCode;
    
    /**
     * 行驶里程数
     * DISTANCE
     */
    private BigDecimal distance;
    
    /**
     * 维护保养里程数？
     * MAINTAIN_DISTANCE
     */
    private BigDecimal maintainDistance;
    
    /**
     * 公司名称
     */
    @ManyToOne(fetch = FetchType.LAZY, optional = true)
    @JoinColumn(name = "organization_id", referencedColumnName = "id")
    @PersistentFormat
    @JsonIgnore(value = true)
    private Organization organization;
    
    /**
     * 公司代码
     */
    private String organizationCode;
    
    /**
     * 公司名称
     */
    private String organizationName;
    
    /**
     * 动力类型
     */
    @ManyToOne(fetch = FetchType.LAZY, optional = true)
    @JoinColumn(name = "vehicle_feature_id", referencedColumnName = "id")
    @JsonIgnore(value = true)
    @PersistentFormat
    private VehicleFeature vehicleFeature;
    
    /**
     * 动力类型编码
     */
    private String vehicleFeatureCode;
    
    /**
     * 动力类型名称
     */
    private String vehicleFeatureName;
    
    /**
     * ?
     * FACILITY_ID
     */
    private String facilityId;
    
    /**
     * ?
     * FROM_YEAR
     */
    private Integer fromYear;
    
    /**
     * ?
     * THRU_YEAR
     */
    private Integer thruYear;
    
    /**
     * ?
     * CHECK_MONTH
     */
    private Integer checkMonth;
    
    @Column(name = "is_disabled")
    private boolean disabled;
    
    /** 创建时间  */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Column(name = "CREATED_TIME")
    private Date createTime;
    
    /** 最后修改时间 */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Column(name = "LAST_MODIFIED")
    private Date lastModifyTime;
    
    /** 最后修改者 */
    private Long lastOperator;
    
    /**
     * ?
     * LOAD_RATIO
     */
    private String loadRatio;
    
    /**
     * IS_AVAILABLE
     */
    @Column(name = "is_available")
    private Boolean available;
    
    /**
     * IS_HEAVY
     */
    @Column(name = "is_heavy")
    private Boolean heavy;
    
    /** 
     * 车队id 
     */
    @Column(name = "TRUCK_TEAM_ID")
    private Long teamId;
    
    /**
     * The default constructor
     */
    public Vehicle() {
    }

    /**
     * @return the id
     */
    public Long getId() {
        return id;
    }

    /**
     * @return the name
     */
    public String getName() {
        return name;
    }

    /**
     * @return the code
     */
    public String getCode() {
        return code;
    }
    
    /**
     * @return
     */
    public String getBrandCNCode() {
		return brandCNCode;
	}

    /**
     * @return the barCode
     */
    public String getBarCode() {
        return barCode;
    }

    /**
     * @return the distance
     */
    public BigDecimal getDistance() {
        return distance;
    }

    /**
     * @return the maintainDistance
     */
    public BigDecimal getMaintainDistance() {
        return maintainDistance;
    }

    /**
     * @return the organization
     */
    public Organization getOrganization() {
        return organization;
    }

    /**
     * @return the organizationCode
     */
    public String getOrganizationCode() {
        return organizationCode;
    }

    /**
     * @return the organizationName
     */
    public String getOrganizationName() {
        return organizationName;
    }

    /**
     * @return the vehicleFeature
     */
    public VehicleFeature getVehicleFeature() {
        return vehicleFeature;
    }

    /**
     * @return the vehicleFeatureCode
     */
    public String getVehicleFeatureCode() {
        return vehicleFeatureCode;
    }

    /**
     * @return the vehicleFeatureName
     */
    public String getVehicleFeatureName() {
        return vehicleFeatureName;
    }

    /**
     * @return the facilityId
     */
    public String getFacilityId() {
        return facilityId;
    }

    /**
     * @return the fromYear
     */
    public Integer getFromYear() {
        return fromYear;
    }

    /**
     * @return the thruYear
     */
    public Integer getThruYear() {
        return thruYear;
    }

    /**
     * @return the checkMonth
     */
    public Integer getCheckMonth() {
        return checkMonth;
    }

    /**
     * @return the disabled
     */
    public boolean isDisabled() {
        return disabled;
    }

    /**
     * @return the createTime
     */
    public Date getCreateTime() {
        return createTime;
    }

    /**
     * @return the lastModifyTime
     */
    public Date getLastModifyTime() {
        return lastModifyTime;
    }

    /**
     * @return the lastOperator
     */
    public Long getLastOperator() {
        return lastOperator;
    }

    /**
     * @return the loadRatio
     */
    public String getLoadRatio() {
        return loadRatio;
    }

    /**
     * @return the available
     */
    public Boolean getAvailable() {
        return available;
    }

    /**
     * @return the heavy
     */
    public Boolean getHeavy() {
        return heavy;
    }

    /**
     * @return the teamId
     */
    public Long getTeamId() {
        return teamId;
    }

    /**
     * @param id the id to set
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * @param name the name to set
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * @param code the code to set
     */
    public void setCode(String code) {
        this.code = code;
    }
    
    /**
     * @param brandCNCode
     */
    public void setBrandCNCode(String brandCNCode) {
		this.brandCNCode = brandCNCode;
	}

    /**
     * @param barCode the barCode to set
     */
    public void setBarCode(String barCode) {
        this.barCode = barCode;
    }

    /**
     * @param distance the distance to set
     */
    public void setDistance(BigDecimal distance) {
        this.distance = distance;
    }

    /**
     * @param maintainDistance the maintainDistance to set
     */
    public void setMaintainDistance(BigDecimal maintainDistance) {
        this.maintainDistance = maintainDistance;
    }

    /**
     * @param organization the organization to set
     */
    public void setOrganization(Organization organization) {
        this.organization = organization;
    }

    /**
     * @param organizationCode the organizationCode to set
     */
    public void setOrganizationCode(String organizationCode) {
        this.organizationCode = organizationCode;
    }

    /**
     * @param organizationName the organizationName to set
     */
    public void setOrganizationName(String organizationName) {
        this.organizationName = organizationName;
    }

    /**
     * @param vehicleFeature the vehicleFeature to set
     */
    public void setVehicleFeature(VehicleFeature vehicleFeature) {
        this.vehicleFeature = vehicleFeature;
    }

    /**
     * @param vehicleFeatureCode the vehicleFeatureCode to set
     */
    public void setVehicleFeatureCode(String vehicleFeatureCode) {
        this.vehicleFeatureCode = vehicleFeatureCode;
    }

    /**
     * @param vehicleFeatureName the vehicleFeatureName to set
     */
    public void setVehicleFeatureName(String vehicleFeatureName) {
        this.vehicleFeatureName = vehicleFeatureName;
    }

    /**
     * @param facilityId the facilityId to set
     */
    public void setFacilityId(String facilityId) {
        this.facilityId = facilityId;
    }

    /**
     * @param fromYear the fromYear to set
     */
    public void setFromYear(Integer fromYear) {
        this.fromYear = fromYear;
    }

    /**
     * @param thruYear the thruYear to set
     */
    public void setThruYear(Integer thruYear) {
        this.thruYear = thruYear;
    }

    /**
     * @param checkMonth the checkMonth to set
     */
    public void setCheckMonth(Integer checkMonth) {
        this.checkMonth = checkMonth;
    }

    /**
     * @param disabled the disabled to set
     */
    public void setDisabled(boolean disabled) {
        this.disabled = disabled;
    }

    /**
     * @param createTime the createTime to set
     */
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    /**
     * @param lastModifyTime the lastModifyTime to set
     */
    public void setLastModifyTime(Date lastModifyTime) {
        this.lastModifyTime = lastModifyTime;
    }

    /**
     * @param lastOperator the lastOperator to set
     */
    public void setLastOperator(Long lastOperator) {
        this.lastOperator = lastOperator;
    }

    /**
     * @param loadRatio the loadRatio to set
     */
    public void setLoadRatio(String loadRatio) {
        this.loadRatio = loadRatio;
    }

    /**
     * @param available the available to set
     */
    public void setAvailable(Boolean available) {
        this.available = available;
    }

    /**
     * @param heavy the heavy to set
     */
    public void setHeavy(Boolean heavy) {
        this.heavy = heavy;
    }

    /**
     * @param teamId the teamId to set
     */
    public void setTeamId(Long teamId) {
        this.teamId = teamId;
    }
}
